/*
 * Copyright (C) 2018 Logos Technology Ltd.
 */

package com.logos.common.keepalive.deviceutil;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;

/**
 * Created by llx on 2018/11/15.
 * 建议放在自己的项目中
 */
public class VivoDeviceUtil {

    /**
     * vivo手机的设置
     *
     * @param context *
     */
    public static void configApp(Context context) {
        try {
            Intent intent = new Intent();
            intent.putExtra("packagename", context.getPackageName());
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.setComponent(ComponentName.unflattenFromString("com.vivo.permissionmanager/.activity.SoftPermissionDetailActivity"));
            context.startActivity(intent);
        } catch (Exception ex) {
            Intent intent = new Intent();
            intent.putExtra("packagename", context.getPackageName());
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.setComponent(ComponentName.unflattenFromString("com.iqoo.secure/.safeguard.SoftPermissionDetailActivity"));
            context.startActivity(intent);
        }

    }
}
